import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/global.css'
// 引入axios并挂载2到原型http上
import axios from 'axios'
// 配置去请求的接口根路径
// axios.defaults.baseURL = 'http://192.168.194.21/Belem/api/v1/'
axios.defaults.baseURL = 'http://api-dataview.bjstarfish.com/api/v1'

// 请求拦截
axios.interceptors.request.use((config) => {
  // 为请求头对象，添加token验证的Authorization
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
Vue.prototype.$http = axios
Vue.config.productionTip = false
Vue.use(ElementUI)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
